const express = require('express');
const router = express.Router();
const messageController = require('../controllers/messageController');
const authenticate = require('../middleware/auth');

// 发送消息 (需要认证)
router.post('/', authenticate, messageController.sendMessage);

// 获取与角色的对话历史
router.get('/character/:characterId', messageController.getCharacterMessages);

// 获取特定用户与角色的对话历史 (需要认证)
router.get('/user/:userId/character/:characterId', authenticate, messageController.getUserCharacterMessages);

module.exports = router;